<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>reg exp</title>
</head>
<body>
<script>
    /* example */
    ;(function () {
        var reg1 = /\bhi.*luck\b/g
        /*
        *   \b 空格
        *   .  任意非换行符
        *
        * */
        var str1 = 'i say hi dd luck enough'
        console.log(reg1.test(str1))
        console.log(str1.match(reg1))

        var reg2 = /^0\d{2}-\d{8}$/g
        /*
        *   \d  0到9的一位数字
        *   {x} 个数为x
        *
        * */
        var str2 = '013-32929999'
        console.log(reg2.test(str2))


    })()
</script>
</body>
</html>